package cn.xiaoming.car.server.content.service.imp;


import cn.xiaoming.car.pojo.car.pojo.entity.Series;
import cn.xiaoming.car.server.ISeriesService;
import cn.xiaoming.car.server.content.dao.persist.mapper.SeriesMapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
@Slf4j
public class SeriesServiceImpl implements ISeriesService {

    @Autowired
    SeriesMapper seriesMapper;

    @Override
    public Page<Series> list(Long num){
        log.debug("来到查询车系的列表，第{}页",num);
        Long pageSize = 8L; // 默认每页显示10条数据
        
        Page<Series> page = new Page<>(num, pageSize);
        Page<Series> pageResult = seriesMapper.selectPage(page,
                Wrappers.<Series>lambdaQuery()
                        .orderByDesc(Series::getId));
        return pageResult;
    }

}
